﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TBSGSVN
{
    public class ConsoleCommands
    {
        //Console command groups
        public static readonly string[] CLOSE = 
        {
            //commands
            "exit",
            "quit",
        };

        /// <summary>
        /// Returns wether command is found in the specified group
        /// </summary>
        /// <param name="command">the command searched for</param>
        /// <param name="group">the group to search</param>
        /// <returns></returns>
        public static bool Contains(string command, string[] group)
        {
            bool found = false;
            int index = 0;

            while (!found && index < group.Length)
            {
                if (command.Equals(group[index]))
                {
                    found = true;
                }
                else
                {
                    index++;
                }
            }

            return found;
        }
    }
}
